package controller

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func IndexController(c *gin.Context) {
	c.HTML(http.StatusOK, "index.html", nil)
}

func HistoryController(c *gin.Context) {
	workflowID, ok := c.GetQuery("workflow_id")
	if !ok {
		panic(ok)
	}
	c.HTML(http.StatusOK, "history.html", gin.H{"workflow_id": workflowID})
}

func DetailController(c *gin.Context) {
	workflowID, ok := c.GetQuery("workflow_id")
	if !ok {
		panic(ok)
	}

	historyID, ok := c.GetQuery("history_id")
	if !ok {
		panic(ok)
	}
	c.HTML(http.StatusOK, "detail.html", gin.H{"workflow_id": workflowID, "history_id": historyID})
}
